<template>
  <div class="pdf-viewer">
    <iframe 
      :src="pdfUrl" 
      frameborder="0" 
      width="100%" 
      height="100%">
    </iframe>
  </div>
</template>

<script>
export default {
  name: 'PdfViewer',
  data() {
    return {
      pdfUrl: '',
      title: ''
    }
  },
  created() {
    this.pdfUrl = this.$route.params.url;
    this.title = this.$route.params.title;
    document.title = this.title || 'PDF 预览';
  }
}
</script>

<style scoped>
.pdf-viewer {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}
</style> 